
export const FetchLogin = ({ username, password }) => {
  console.log('username: ', username, password)
  if (username === 'devin' && password === '123') {
    return Promise.resolve({
      code: 1,
      msg: 'success',
      data: {
        token: 'xxxx.xxxx.xxx'
      }
    })
  } else {
    return Promise.reject({
      code: 0,
      msg: '登陆失败',
    })
  }
}

// 获取用户信息 要求接收一个参数（token）
export const FetchGetUserInfo = () => {
  return Promise.resolve({
    code: 1,
    msg: 'success',
    data: {
      userInfo: {
        name: 'devin',
        avatar: 'https://www.robohash.org/2',
        address: '上海市奉贤区',
        gender: 1,
        phone: '123'
      }
    }
  })
}